/*
 *   This file is part of <open-parametrics>
 *   Copyright (c) 2006-2008 Miguel-Angel Sicilia
 *
 *   open-parametrics is free software: you can redistribute it and/or modify
 *   it under the terms of the Lesser GNU General Public License as
 *   published by the Free Software Foundation, either version 3 of
 *   the License, or (at your option) any later version.
 *
 *   open-parametrics is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with open-parametrics.  If not, see <http://www.gnu.org/licenses/>.
 */

package es.uah.cc.ie.parametrics.eval;

import es.uah.cc.ie.parametrics.CostDriver;
import es.uah.cc.ie.parametrics.CostEstimatingRelationship;
import es.uah.cc.ie.parametrics.Dataset;
import java.util.Collection;

/**
 * Cost Estimating Relationships evaluators.
 *
 * @author Miguel-Angel Sicilia
 */
public class CEREvaluatorImpl implements CEREvaluator {

    private CostEstimatingRelationship _cer = null;

    private double _mmre = 0;

    private double[] _pred;
    private int [] _predLevels;

    public CEREvaluatorImpl(CostEstimatingRelationship cer){
        _cer = cer;
        _pred = new double[4];
        _predLevels = new int[4];
        // TO-DO: decide the pred levels to be computed.
    }
    /**
     * Evaluate the CER.
     */
    public CEREvaluationResults evaluate(Dataset data){
        // get the cost drivers included in the CER:
        Collection<CostDriver> cds = _cer.getCostDrivers();
        // initialize:
        _mmre = 0.0;

        for (int i=0; i < data.getSize(); i++){
            // compute mmre and pred
        }
        return null;
    }

}
